#pragma once

#include <string>
#include <iostream>
#include <sstream>

class BaseDump {
public:
    BaseDump(){}
    virtual ~BaseDump(){}
    virtual void Dump(std::ostream& os) const{}
    std::string ToString() const{
        std::stringstream ss;
        Dump(ss);
        return ss.str();
    }
};

inline std::ostream &operator<<(std::ostream &os, const BaseDump& base_dump) {
    base_dump.Dump(os);
    return os;
}